import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;


public class ComplexNormalizer implements Normalizer {
	
	private List<Normalizer> normalizers;
	
	public ComplexNormalizer() {
		normalizers = new ArrayList<Normalizer>();
	}
	
	public void addNormalizer(Normalizer n) {
		normalizers.add(n);
	}

	@Override
	public Set<String> getTerms(List<String> tokens) throws IOException {
		Set<String> terms = new HashSet<String>(tokens);
		
		for(Normalizer n : normalizers) {
			terms = n.getTerms(new ArrayList<String>(terms));
		}		
				
		return terms;
	}

}
